
package com.ohaku.controller;


import com.ohaku.anno.DefaultValue;
import com.ohaku.service.DragonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/api/dragon")
public class DragonController {


    @DefaultValue(value = "xyz")
    private String name;

    @Autowired
    private DragonService dragonService;

    @RequestMapping(value = "name", method = RequestMethod.GET,
            produces = "application/json;charset=UTF-8")
    public String getName(@DefaultValue(value = "fire") String skill) {
        return skill + " " + dragonService.getName() + " " + name;
    }
}
